import axios from 'axios'
import config from '../config'

export function noticeList(params) {
  return axios.get(config.SERVER_URL + window.apiPath + '/notices-ps',{params:params}, {responseType: 'json'})
    .then(resp => resp)
}
export function createNotice(entity) {
  return axios.post(config.SERVER_URL + window.apiPath + '/notices', {...entity, responseType: 'json'})
    .then(resp => resp.data)
}
export function updateNotice(entity) {
  return axios.put(config.SERVER_URL + window.apiPath + '/notices', {...entity, responseType: 'json'})
    .then(resp => resp.data)
}
export function deleteNotice(id) {
  return axios.delete(config.SERVER_URL + window.apiPath + '/notices/' + id)
    .then(resp => resp.data)
}
export function getOneNotice(id) {
  return axios.get(config.SERVER_URL + window.apiPath + '/notices/' + id)
    .then(resp => resp.data)
}
